package com.robotserver.orders.mapper;

import com.robotserver.orders.entity.JdTokens;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Auther: jianghan
 * @Date: 2019/11/12 11:56
 * @Description:
 */
@Repository
public interface JdTokensMapper {
    JdTokens getByUnionId(@Param("unionId") String unionId);

    void update(JdTokens jdToken);

    void add(JdTokens jdToken);

    List<JdTokens> getTokens(@Param("validTime") int validTime,@Param("pageIndex") int pageIndex,@Param("pageSize")int pageSize);

    int getCount(@Param("validTime") int validTime);

    void updateHeartbeat(@Param("id") Long id,@Param("time") int time);

    List<JdTokens> getNotRunToken(@Param("validTime") int validTime,@Param("lasttime") int lasttime);

    JdTokens getByCode(@Param("code") String code);

    List<JdTokens> getAllTokens(@Param("validTime") int validTime);
}
